<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../common/common_java.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<%@include file="../common/common_meta.jsp" %>  
    <meta name="keywords" content="投票,投票网,大众,民意,调查,">
	<%@include file="../common/common_css.jsp"%>
    <title>新增投票-大众投票</title>
</head>
<body>
   <jsp:include page="../common/common_header.jsp">
		<jsp:param name="active" value="vote_user"/>
	</jsp:include>
    <section class="container" >
        <h3 class="mt-10">个人中心</h3>
        <div class="line"></div>
        <div class="responsive">
            <div class="row cl">
                <!-- left -->
                <div class="col-md-2">
	                <jsp:include page="sidebar.jsp">
						<jsp:param name="active" value="vote_add"/>
					</jsp:include>
                </div>
                <!-- right -->
                <div class="col-md-10">
                    <!--panel 1 start -->
                    <div class="panel shadow panel-default radius mt-20">
                        <div class="panel-body">
                            <h4>新增投票</h4>
                            <div class="line"></div>
                            <!--form start-->
                            <form action="${ctx}/vote/save" method="post" class="form form-horizontal responsive" id="defaultform">
                                <div class="row cl">
                                    <label class="form-label col-xs-2">投票名称：</label>
                                    <div class="formControls col-xs-5">
                                        <input type="text" class="input-text" placeholder="5~40个字符" name="title" maxlength="40" datatype="*5-40" nullmsg="投票名称不能为空！">
                                    </div>
                                    <div class="col-xs-5"></div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-2">选择分类：</label>
                                    <div class="formControls col-xs-5">
                                        <span class="select-box">
                                            <select class="select" size="1" name="classId" datatype="*" nullmsg="请选择分类！">
                                                <option value="" selected>请选择分类</option>
                                                <c:forEach items="${classList}" var="classItem">
	                                                <option value="${classItem.id}" >${classItem.name}</option>
                                                </c:forEach>
                                            </select>
                                        </span>
                                    </div>
                                    <div class="col-xs-5"> </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-2">是否单选：</label>
                                    <div class="formControls skin-minimal col-xs-5">
                                        <div class="radio-box">
                                            <input type="radio" id="isRadio-1" name="isRadio" value="1" datatype="*" nullmsg="请选择类型！" />
                                            <label for="isRadio-1">单选</label>
                                        </div>
                                        <div class="radio-box">
                                            <input type="radio" id="isRadio-2" name="isRadio" value="0"/>
                                            <label for="isRadio-2">复选</label>
                                        </div>
                                    </div>
                                    <div class="col-xs-5"> </div>
                                </div>
                                <div id="voteItems">
	                                <div class="row cl ">
	                                    <label class="form-label col-xs-2">选项1：</label>
	                                    <div class="formControls col-xs-5" >
	                                        <input  type="text" class="input-text" placeholder="10~40个字符" name="itemList[0].content" maxlength="40" datatype="*10-40" nullmsg="选项不能为空！">
	                                    </div>
	                                    <div class="col-xs-5"></div>
	                                </div>
	                                <div class="row cl">
	                                    <label class="form-label col-xs-2">选项2：</label>
	                                    <div class="formControls col-xs-5">
	                                        <input  type="text" class="input-text" placeholder="10~40个字符" name="itemList[1].content" maxlength="40" datatype="*10-40" nullmsg="选项不能为空！">
	                                    </div>
	                                    <div class="col-xs-5"></div>
	                                </div>
	                                <div class="row cl">
	                                    <div class="col-xs-10 col-xs-offset-2">
	                                        <input data-item-count="2" id="addItemBtn" class="btn btn-primary" type="button" value="&nbsp;&nbsp;增加选项+&nbsp;&nbsp;">
	                                    </div>
	                                </div>
                                 </div>
                                 <div id="voteLabels">
	                                <div class="row cl">
	                                    <label class="form-label col-xs-2">标签1：</label>
	                                    <div class="formControls col-xs-5">
	                                        <input type="text" class="input-text" placeholder="2~5个字符" name="labelList[0].name" datatype="*2-5" maxlength="5" nullmsg="标签不能为空！">
	                                    </div>
	                                    <div class="col-xs-5"></div>
	                                </div>
	                                <div class="row cl">
	                                    <div class="col-xs-10 col-xs-offset-2">
	                                        <input data-label-count="1" id="addLabelBtn" class="btn btn-primary" type="button" value="&nbsp;&nbsp;增加标签+&nbsp;&nbsp;">
	                                    </div>
	                                </div>
                                </div>
                                
                                <div class="row cl">
                                    <label class="form-label col-xs-2">描述：</label>
                                    <div class="formControls col-xs-5">
                                        <textarea name="desc" cols="" rows="" class="textarea"  placeholder="您可以对你的投票进行进一步描述，或写一下相关背景。" datatype="*10-500" maxlength="500"  nullmsg="描述不能为空！" onKeyUp="textarealength(this,500)"></textarea>
                                        <p class="textarea-numberbar"><em class="textarea-length">0</em>/500</p>
                                    </div>
                                    <div class="col-xs-5"> </div>
                                </div>
                                <div class="row cl">
                                    <div class="col-xs-10 col-xs-offset-2">
                                        <input class="btn btn-primary" type="submit"  id="submitBtn" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" >
                                    </div>
                                </div>
                            </form>
                            <!--form end-->
                        </div>
                    </div>
                    <!--panel 1 end -->
                </div>
            </div>
        </div>
    </section>
<%@include file="../common/common_footer.jsp" %> 
<%@include file="../common/common_js.jsp" %>
<script type="text/javascript" src="${jsBase}/vote/add.js" ></script>
</body>

</html>